import request from '@/utils/request'

const getExhibitionList = (page, limit, key) => {
  return request('/exhibition/list', {
    method: 'get',
    params: {
      page,
      limit,
      key
    }
  })
}

const getExhibitionListByFuzzyQuery = (page, limit, key) => {
  return request('/exhibition/listByFuzzyQuery', {
    method: 'get',
    params: {
      page,
      limit,
      key
    }
  })
}

const deleteExhibitionList = (exhibitionNos) => {
  return request('/exhibition/delete', {
    method: 'post',
    data: {
      exhibitionNos
    }
  })
}

const getExhibitionById = (exhibitionId) => {
  return request({
    url: `/exhibition/info/${exhibitionId}`,
    method: 'get'
  })
}

const saveOrUpdateExhibition = (exhibitionId, exhibition) => {
  return request(`/exhibition/${!exhibitionId ? 'save' : 'update'}`, {
    method: 'post',
    data: exhibition
  })
}

export { getExhibitionList, getExhibitionListByFuzzyQuery, deleteExhibitionList, getExhibitionById, saveOrUpdateExhibition }
